package com.hjw.exer2;

/**
 * 餐厅获取客人点的菜单，通知厨师做哪些菜
 * @author hjwStrart
 * @create 2022-01-11 15:11
 */
public class Restaurant {
    private Guest guest;

    //必须传客人
    public Restaurant(Guest guest) {
        this.guest = guest;
    }

    public Guest getGuest() {
        return guest;
    }

    /**
     * 得到客人点的菜
     * @return
     */
    private String[] getMenu(){
        return guest.getDishNames();
    }

    /**
     * 将客人点的菜告诉厨师
     * @return
     */
    public void advice(Chef chef){
          if(getMenu() == null){
              return;
          }else{
              chef.setMenu(getMenu());
          }
    }

}
